package com.daoeping.action;

import java.util.ArrayList;
import java.util.List;
import com.daoeping.domain.Bsc_skill;
import com.daoeping.domain.JsonData;
import com.daoeping.service.SkillService;
import com.daoeping.util.ConverntJsonData;
import com.opensymphony.xwork2.ActionSupport;

public class SkillAction extends ActionSupport{
	
	private static final long serialVersionUID = -3753515573599532991L;
	private SkillService skillService;
	private JsonData jsonData;
	private List<Bsc_skill> skilllist;
	
	public List<Bsc_skill> getSkilllist() {
		return skilllist;
	}

	public void setSkilllist(List<Bsc_skill> skilllist) {
		this.skilllist = skilllist;
	}

	public JsonData getJsonData() {
		return jsonData;
	}

	public void setJsonData(JsonData jsonData) {
		this.jsonData = jsonData;
	}

	public SkillService getSkillService() {
		return skillService;
	}

	public void setSkillService(SkillService skillService) {
		this.skillService = skillService;
	}

	public String findAllSkill(){
		jsonData = new JsonData();
		skilllist = skillService.findBsc_skills();
		List <String[]> strList = new ArrayList<String[]>();
		for (Bsc_skill bsc_skill : skilllist) {
			String [] strarr = new String[2];
			strarr[1] = bsc_skill.getId()+"";
			strarr[0] = bsc_skill.getName();
			strList.add(strarr);
		}
		jsonData.setJsonData( new ConverntJsonData().getJsonData(strList)+"");
		return "allskill";
		
	}
	
}
